<%@ page language="java" contentType="text/html; charset=UTF-8"
	import="java.sql.*,java.util.*,com.zhida84.Servlet.*,com.zhida84.Impl.*,com.zhida84.Entity.*,com.zhida84.Dao.*,com.zhida84.Convert.*"
	pageEncoding="UTF-8"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="shangzhengbo&sunchangxing" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>美食推荐</title>
<script type="text/javascript">
	/**
	function onBridgeReady() {
		WeixinJSBridge.call('hideOptionMenu');
	}
	if (typeof WeixinJSBridge == "undefined") {
		if (document.addEventListener) {
			document.addEventListener('WeixinJSBridgeReady', onBridgeReady,
					false);
		} else if (document.attachEvent) {
			document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
			document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
		}
	} else {
		onBridgeReady();
	}
	// 对浏览器的UserAgent进行正则匹配，不含有微信独有标识的则为其他浏览器
	var useragent = navigator.userAgent;
	if (useragent.match(/MicroMessenger/i) != 'MicroMessenger') {
		// 这里警告框会阻塞当前页面继续加载
		var opened = window.open('about:blank', '_self');
		opened.opener = null;
		opened.close();
		window.location.href = "../../error/wechat.html"
	}*/
</script>
<style>
.editRight {
	background: none !important;
}
</style>
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/css/registarr.css">
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/css/personal/showpersonal.css">
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/jquery.min.js"></script>

</head>
<body onLoad="init()">
	<div id="pertitle" class="registTitle">
		<label class="registLeft" onclick="backhistory()"></label><span>个人信息</span><label
			class="registLeft registRight editRight"><input type="button"
			value="编辑" id="edit" onClick="editbtn()"></label>
	</div>
	<script type="text/javascript">
		function backhistory() {
			window.location.href = "../../personal.html";
		}
	</script>
	<h2
		style="background: rgba(219, 204, 205, 1.00); text-indent: 1.5em; margin-top: 7%;">基本资料</h2>
	<%
		try {
			Cookie[] cookies = request.getCookies();
			String phone = null;
			String str = null;
			ResultSet rs = null;
			if (cookies != null) {
				for (Cookie c : cookies) {
					if (c.getName().equals("phone"))// 依据cookies里面的手机
					{
						phone = c.getValue();
					}
				}
			}

			if (phone == null) {
				response.sendRedirect("../../personal.html");
			} else {
				//获取用户ID			
				UserDao userDao = new UserImpl();
				rs = userDao.getZFB(phone);

			}
			while (rs.next()) {
				String name = rs.getString("userReName");
				String userAge = rs.getString("userAge");
				String userSexT = rs.getString("userSex");
				String userSexF = null;
				//处理男女问题
				if (userSexT.equals("女")) {
					userSexF = "男";
				}
				if (userSexT.equals("男")) {
					userSexF = "女";
				}
				String userPhone = Base64CodeO.decode(rs
						.getString("userPhone"));
				String school = rs.getString("school");
				String qqwc = rs.getString("qqwc");
				String description = rs.getString("description");
				String major = rs.getString("major");
				String hopeJob = rs.getString("hopeJob");
	%>
	<div class="list listtop">
		<label class="listtitle">用户名<em style="color: red">*</em></label> <label> <input
			type="text" placeholder="昵称" id="name" value="<%=name%>"
			readonly>
		</label>
	</div>
	<div class="list">
		<label class="listtitle">性别<em style="color: red">*</em></label> <label>
			<select id="sex" disabled>
				<option value="<%=userSexT%>"><%=userSexT%></option>
				<option value="<%=userSexF%>"><%=userSexF%></option>
		</select>
		</label>
	</div>
	<div class="list">
		<label class="listtitle">年龄<em style="color: red">*</em></label> <label>
			<input type="text" id="age" value="<%=userAge%>" readonly="readonly">
		</label>
	</div>
	<div class="list">
		<label class="listtitle">手机号</label> <label> <input
			type="text" id="tel" value="<%=userPhone%>" readonly>
		</label>
	</div>
	<div class="list">
		<label class="listtitle">QQ/微信</label> <label> <input
			type="text" id="wechat" placeholder="请输入QQ/微信" value="<%=qqwc%>"
			readonly>
		</label>
	</div>
	<!-- 
	<h2 style="background: rgba(219, 204, 205, 1.00); text-indent: 1.5em;">教育经历</h2>
	<div class="list listtop">
		<label class="listtitle">学校</label> <label> <input type="text"
			id="school" placeholder="请输入所在学校" value="<%=school%>" readonly>
		</label>
	</div>
	<div class="list">
		<label class="listtitle">专业<em style="color: red">*</em></label> <label>
			<input type="text" id="zy" placeholder="请输入所学专业" value="<%=major%>"
			readonly>
		</label>
	</div>
	<div class="list">
		<label class="listtitle">期望工作</label> <label> <input
			type="text" id="exchect" value="<%=hopeJob%>" readonly>
		</label>
	</div> -->
	<div
		style="width: 100%; background: #fff; margin-top: 5%; margin-bottom: 5%;">
		<h4 id="ms">自我描述</h4>
		<textarea rows="1" id="text" disabled="disabled">
		<%=description%>
</textarea>
		<%
			}
			} catch (Exception e) {
			}
		%>
	</div>
	<script type="text/javascript"
		src="<%=request.getContextPath()%>/js/grxx.js"></script>

</body>
</html>
